<!-- File: /app/views/students/index.ctp -->


<a href="http://localhost">Вернуться на главную</a>
<h2>Students List</h2>
<p><?php echo $html->link("Add Student", array('action'=>'add')); ?>
<table>
	<tr>
		<th>Id</th>
		<th>First Name</th>
                <th>Last Name</th>
		<th>DopName</th>
		<th>Actions</th>
		<th>Created</th>
		<th>Modified</th>
	</tr>

<!-- Проходим в цикле массив $posts, выводя данные постов -->

<?php foreach ($students as $student): ?>
	<tr>
		<td><?php echo $student['Student']['id']; ?></td>
		<td><?php echo $student['Student']['Name']; ?></td>
		<td><?php echo $student['Student']['LastName']; ?></td>
		<td><?php echo $student['Student']['DopName']; ?></td>
                <td>
			<?php echo $html->link('View', array('action'=>'view', 'id'=>$student['Student']['id']));?>
			<?php echo $html->link('Edit', array('action'=>'edit', 'id'=>$student['Student']['id']));?>
			<?php echo $html->link(
				'Delete', 
				array('action'=>'delete', 'id'=>$student['Student']['id']), 
				null, 
				'Are you sure?'
			)?>
		</td>
		<td><?php echo $student['Student']['created']; ?></td>
		<td><?php echo $student['Student']['modified']; ?></td>
	</tr>
<?php endforeach; ?>

</table>